import request from "@/utils/request";

// 热门搜索
export const serachHot = async () => {
  return await request({
    url: "/search/hot",
    method: "get",
  });
};

// 热门搜索
export const serachSuggest = async (keywords: string) => {
  return await request({
    url: `/search/suggest?keywords=${keywords}`,
    method: "get",
  });
};

// 搜索类型；默认为 1 即单曲 , 取值意义 : 1: 单曲, 10: 专辑, 100: 歌手, 1000: 歌单, 1002: 用户, 1004: MV, 1006: 歌词, 1009: 电台, 1014: 视频, 1018:综合
export const cloudsearch = async ({
  keywords = "",
  limit = 30,
  offset = 0,
  type = "1",
}) => {
  return await request({
    url: `/cloudsearch?keywords=${keywords}&limit=${limit}&offset=${offset}&type=${type}`,
    method: "get",
  });
};
